{$layout}

<div v-if="error.length > 0" class="ui message warning">
    {{error}}
</div>

<div v-if="serverChanged" class="ui message warning">
    配置已改变，需要你在命令行下重启TeaWeb服务后生效。
</div>

<div v-if="error.length == 0">
    <h3>HTTP <a href="/settings/server/http">修改</a> </h3>

    <form>
    <table class="ui table definition selectable">
        <tr>
            <td>状态</td>
            <td>
                <span class="enabled" v-if="server.http.on">启用中</span>
                <span class="disabled" v-if="!server.http.on">已关闭</span>
            </td>
        </tr>
        <tr>
            <td class="title">绑定地址</td>
            <td>{{server.http.listen.join(",")}}
                <p class="ui comment">如果地址中的IP是0.0.0.0，表示服务器的所有IP都可以用来使用访问此服务。</p>
            </td>
        </tr>
    </table>

    <div class="ui block"></div>

    <h3>HTTPS <a href="/settings/server/https">修改</a></h3>
    <table class="ui table definition selectable">
        <tr>
            <td>状态</td>
            <td>
                <span class="enabled" v-if="server.https.on">启用中</span>
                <span class="disabled" v-if="!server.https.on">已关闭</span>
            </td>
        </tr>
        <tr>
            <td class="title">绑定地址</td>
            <td>{{server.https.listen.join(",")}}
                <p class="ui comment">如果地址中的IP是0.0.0.0，表示服务器的所有IP都可以用来使用访问此服务。</p>
            </td>
        </tr>
        <tr>
            <td>证书文件<span class="small">（Cert）</span></td>
            <td>
                <span class="enabled" v-if="server.https.cert.length > 0">{{server.https.cert}}</span>
                <span class="disabled" v-if="server.https.cert.length == 0">还没有设置证书</span>
            </td>
        </tr>
        <tr>
            <td>私钥文件<span class="small">（Key）</span></td>
            <td>
                <span class="enabled" v-if="server.https.key.length > 0">{{server.https.key}}</span>
                <span class="disabled" v-if="server.https.key.length == 0">还没有设置私钥</span>
            </td>
        </tr>
    </table>

    </form>
</div>